package com.cjq.es.controller;

import com.cjq.common.domain.request.ProjectQueryReq;
import com.cjq.common.domain.response.ProjectQueryRes;
import com.cjq.common.result.PageResult;
import com.cjq.common.result.Result;
import com.cjq.es.service.EsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/es")
public class EsController {
    @Autowired
    private EsService esService;

    /**
     * 搜索
     * @param projectQueryReq
     * @return
     */
    @PostMapping("/search")
    public Result<PageResult<ProjectQueryRes>> search(@RequestBody ProjectQueryReq projectQueryReq){
        return esService.search(projectQueryReq);
    }


}
